#ifndef __MOTO_H
#define __MOTO_H


#define pai 3.1415926535f

typedef struct Planner
{
   float acc_percent;
   float dec_percent;
   float Last_set_pos;
   float Last_pos;
   float All_Err;
   
}Planner;

extern Planner sPlanner[4];

float Moto_path_planning(Planner *sPlanner,float pos,float threshold,float min_speed,float max_speed,float set_pos );


void Moto_Planning_Init(void);

void Moto_planning_Init(Planner *sPlanner,float acc,float dec);

float Moto_Err_path_planning(Planner *sPlanner,float Err,float min_speed,float max_speed,float set_pos);

float Moto_optimal_planning(float angle_max,float angle_min,float Err);


float Moto_Control_Limit(float moto_control_min, float moto_control_max, float limit);

float moto_math_out(float out_min,float out_max,float in_min,float in_max,float in);


#endif





